<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>arguments</title>
</head>
<body>
<script>
    //arguments参数的集合
    //slice 复制原数组   []  Array
    function likeSlice(oriArr) {
//        this
        let curArr = [];
        /*for (let i =0;i<oriArr.length;i++){
            curArr.push(oriArr[i])
        }*/


//        Array.map();


        return curArr;
    }

//    likeSlice([1,2,3,4]);

    function likeCall(context) {
        likeSlice(context)
    }


    function fn() {
        console.log(arguments);//伪数组
        var likeArr = [].slice.call(arguments);


//        var likeArr = Array.prototype.slice.call(arguments);


        var arr = likeArr.map((item)=>{
            console.log("数组方法",item)
        });
        return arr;
    }

    fn("a","b","c",4);


</script>
</body>
</html>